package com.itheima.Jiuye14;

import java.util.concurrent.CountDownLatch;

public class Mother extends Thread {
    private CountDownLatch countDownLatch;
    public Mother(CountDownLatch countDownLatch) {
        this.countDownLatch = countDownLatch;
    }
    @Override
    public void run() {
        //先等待
        try {
            //当计数器变成0的时候，会自动唤醒Mother这条等待的线程
            countDownLatch.await();//无限等待
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        //收拾碗筷
        System.out.println("妈妈在收拾碗筷");
        //super.run();
    }
}
